package com.example.eureka_ribbon_client.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author rcl
 * @date 2019/4/17 16:20
 */
@RestController
public class ConsumerController {
    @Autowired
    RestTemplate restTemplate;

    @RequestMapping(value = "/getinfo", method = RequestMethod.GET)
    public String add() {

        return restTemplate.getForEntity("http://compute-service/getInfo", String.class).getBody();
    }
}
